跳到主要内容

GetQuoteText

Returns the quote text of the current comment.

Syntax

expression.GetQuoteText();

expression - A variable that represents a ApiComment class.

Parameters

This method doesn't have any parameters.

Returns

Number

Example

This example shows how to get the quote text of the comment.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("This is just a sample text");
Api.AddComment(paragraph, "comment", "John Smith");
let comments = doc.GetAllComments();
let quoteText = comments[0].GetQuoteText();
paragraph = Api.CreateParagraph();
paragraph.AddText("Comment quote text: " + quoteText);
doc.Push(paragraph);